<?php if (Yii::app()->user->hasFlash('success')): ?>
    <div class="alert alert_grey">
        <img height="24" width="24" src="<?php echo Yii::app()->params['backendUrl']; ?>/images/icons/small/grey/success.png">
        <?php echo Yii::app()->user->getFlash('success'); ?>
    </div>
<?php endif; ?>
<?php if (Yii::app()->user->hasFlash('error')): ?>
    <div class="alert alert_grey">
        <img height="24" width="24" src="<?php echo Yii::app()->params['backendUrl']; ?>/images/icons/small/grey/alert_2.png">
        <?php echo Yii::app()->user->getFlash('error'); ?>
    </div>
<?php endif; ?>

<div class="flat_area grid_16">
    <h2>Report Withdrawal Ewallet</h2>
</div>
<?php
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
        $('.search-form').toggle();
        return false;
});
$('.search-form form').submit(function(){
        $.fn.yiiGridView.update('sys-ewallet-withdrawal-grid', {
                data: $(this).serialize()
        });
        return false;
});
");
?>
<div class="search-form">
<div class="form">
<div class="box grid_16 round_all">
    <h2 class="box_head grad_colour round_all">Advanced Search</h2>
    <a href="#" class="grabber">&nbsp;</a>
    <a href="#" class="toggle toggle_closed">&nbsp;</a>
    <div class="toggle_container" style="display:none;">
        <?php
        $this->renderPartial('_search');
        ?>
    </div>

</div>
</div>
</div>
<?php
$this->widget('zii.widgets.grid.CGridView', array(
    //'id'=>'sys-ewallet-withdrawal-grid',
    'dataProvider'=>$model->search_withdrawal_ewallet(),
    'filter'=>$model,
    'columns' => array(
        array('header' => '#',
              'type' => 'raw',
              'value' => 'CHtml::checkBox("withdraw[]", false, array("value" => $data->ewallet_withdrawal_id));',
              'htmlOptions' => array('style' => 'text-align:center;')),
        array('header' => 'No.',
              'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)."."',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
        array(
	      'header'=>'MID',	
	      'name'=>'member_mid',
              'value' => '$data->ewallet_withdrawal_to_network->network_mid',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
        array('header' => 'Member Name',
              'name'=>'member_name',
	       'value' => '$data->ewallet_withdrawal_to_network->rel_network_to_member->member_name',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
        array('header' => 'Bank Name',
	      'name'=>'bank_name',
              'value' => '$data->ewallet_withdrawal_to_network->rel_network_to_member->rel_member_to_ref_bank->bank_name',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
        array('header' => 'Bank Account No',
	      'name'=>'bank_no',
              'value' => '$data->ewallet_withdrawal_to_network->rel_network_to_member->member_bank_account_no',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
        array(
	      'name'=>'ewallet_withdrawal_value',
              'value' => 'number_format($data->ewallet_withdrawal_value);',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
        array('name' => 'ewallet_withdrawal_datetime',
              'value' => 'Yii::app()->dateFormatter->formatDateTime($data->ewallet_withdrawal_datetime,"medium","")',
               'htmlOptions' => array('style' => 'text-align:center;'))
        ),
    'pager' => array(
        'cssFile' => Yii::app()->params['backendUrl'] . '/css/style-pager.css',
        'header' => '',
        'firstPageLabel' => 'First',
        'prevPageLabel' => 'Previous',
        'nextPageLabel' => 'Next',
        'lastPageLabel' => 'Last',
    ),
   // 'selectableRows' => 2,
   // 'selectionChanged' => 'userClicks',
    'cssFile' => Yii::app()->params['backendUrl'] . '/css/style-gridview.css',
));
?>
<div style="border-top:1px solid silver; border-bottom:1px solid silver; background: #EEEEEE; padding:10px;">
<?php
$xls_icon=Yii::app()->baseUrl.'/images/report_icon/excel.png';
echo CHtml::form('', 'POST');
echo CHtml::imageButton($xls_icon,array('alt'=>'Excel','title'=>'Download in Excel','name'=>'button[xls]','value'=>'xls'));
echo CHtml::endForm();
?>
</div>

